<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>print</title>
</head>
<body>

<button onclick="print()">打印</button>

<script type="text/javascript">
    
    function print() {

        var printWin = window.open('打印窗口', '_blank')
            ,style = ['<style>'
            ,'body{font-size: 12px; color: #666;}'
            ,'table{width: 100%; border-collapse: collapse; border-spacing: 0;}'
            ,'th,td{line-height: 20px; padding: 9px 15px; border: 1px solid #ccc; text-align: left; font-size: 12px; color: #666;}'
            ,'a{color: #666; text-decoration:none;}'
            ,'*.layui-hide{display: none}'
            ,'</style>'].join('')
            ,html = $(that.layHeader.html()); //输出表头

        html.append("-----------------------------------"); //输出表体
        html.append("-----------------------------------"); //输出表体
        html.append("-----------------------------------"); //输出表体
        html.append("-----------------------------------"); //输出表体

        printWin.document.write(style + html.prop('outerHTML'));
        printWin.document.close();
        printWin.print();
        printWin.close();
        
    }


</script>
</body>
</html>